package com.yeqifu.bus.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeqifu.bus.entity.Type;
import com.yeqifu.bus.mapper.TypeMapper;
import com.yeqifu.bus.service.ITypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * InnoDB free: 9216 kB; (`providerid`) REFER `warehouse/bus_provider`(`id`) 服务实现类
 * </p>
 *
 * @author 艾琦
 * @since 2020-12-06
 */
@Service
@Transactional
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements ITypeService {
    /**
     * 查询这个商品有没有已经存在
     * @return
     */
    @Override
    public List<Type> searchexist(String type) {
       List<Type> typelist = baseMapper.searchexist(type);
        return typelist;
    }

    /**
     * 加载类型的全部名称
     * @return
     */
    @Override
    public List<Type> searchalltype() {
        List<Type> typenamelist = baseMapper.searchalltype();
        return typenamelist;
    }

    /**
     * 根据id删除类型
     * @return
     */
    @Override
    public void deletetypebyid(Integer id) {
        //根据类型id删除类型
        this.getBaseMapper().deletetypebyid(id);
    }
}
